package com.cs.study.homework._0304;

import java.io.*;

public class Demo4 {
    public static void main(String[] args) throws IOException {
        String srcFileName = "E:\\a\\aa";
        String destFileName = "E:\\a\\copy_aa";

        File srcFile = new File(srcFileName);
        File destFile = new File(destFileName);

        // 创建输入流对象
        InputStreamReader in =
                new InputStreamReader(new FileInputStream(srcFile));
        // 创建输出流对象
        OutputStreamWriter out =
                new OutputStreamWriter(new FileOutputStream(destFile));

        long start = System.currentTimeMillis();

        // 调用工具类中的方法
        // FileUtils.copySingleChar(in, out);
        //com.cskaoyan.utils.FileUtils.copyMultiChars(in, out);

        long end = System.currentTimeMillis();
        System.out.println(end - start);
        // close
        in.close();
        out.close();
    }
}

